package com.example.mybatis.exception;

/**
 * Created with IntelliJ IDEA.
 * User: ThinkPad
 * Date: 2021-04-25 20:13
 * This is my work in reachauto code.
 * mail:chenxiangning@reachauto.com
 * Description:
 */

import com.example.mybatis.vo.Status;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class BaseException extends RuntimeException {
    private Integer code;
    private String message;

    public BaseException(Status status) {
        super(status.getMessage());
        this.code = status.getCode();
        this.message = status.getMessage();
    }

    public BaseException(Integer code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
}
